package 第四章作业.O407;

public class Area2 {
    public static void main(String[] args){
        TriangleArea(2,2);
        SquareArea(2);
        RectangleArea(2,3);
    }

    public static void TriangleArea(double a,double b){
        System.out.println("三角形的底为"+a);
        System.out.println("三角形的高为"+b);
        System.out.println("三角形的面积为"+(a*b/2));
        System.out.println(" ");
    }
    public static void SquareArea(double a){
        System.out.println("正方形的边长为"+a);
        System.out.println("正方形的面积为"+Math.pow(a,2));
        System.out.println(" ");
    }
    public static void RectangleArea(double a,double b){
        System.out.println("长方形的长为"+a);
        System.out.println("长方形的宽为"+b);
        System.out.println("长方形的面积为"+a*b);
        System.out.println(" ");
    }
}
